package com.itheima.vms.controller;

import com.itheima.vms.domain.po.City;
import com.itheima.vms.response.Result;
import com.itheima.vms.service.ICityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/city")
public class CityController {
    @Autowired
    private ICityService cityService;
    //查询所有
    @GetMapping
    public Result getAllCity(){
        List<City> list = cityService.getAllCity();
        return Result.ok(list);
    }
}
